home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / GUICtrlSendMsg.au3 < prev    next >
Text File  |  2007-09-08  |  638b  |  26 lines

  1. #include <GUIConstantsEx.au3>
  2. #include <EditConstants.au3>
  3.  
  4. GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
  5.  
  6. $nEdit = GUICtrlCreateEdit ("line 0", 10,10)
  7. GUICtrlCreateButton ("Ok", 20,200,50)
  8. GUISetState ()
  9.  
  10. For $n=1 To 5
  11. GUICtrlSetData ($nEdit,@CRLF & "line "& $n)
  12. Next
  13.  
  14.  
  15. ; Run the GUI until the dialog is closed
  16. Do
  17.     $msg = GUIGetMsg()
  18.     If $msg >0 Then
  19.         $n=GUICtrlSendMsg ($nEdit, $EM_LINEINDEX,-1,0)
  20.         $nline=GUICtrlSendMsg( $nEdit, $EM_LINEFROMCHAR,$n,0)
  21.         GUICtrlSetState ($nEdit,$GUI_FOCUS)    ; set focus
  22.  
  23.         MsgBox (0,"Currentline",$nLine)
  24.     EndIf
  25. Until $msg = $GUI_EVENT_CLOSE
  26.